import {httpGet, httpPost, httpPut} from '@frontend/vue-common'
import {getCurrentGlobalProperties} from "@frontend/vue-common/src/app";

export const listCounterpartyPermissionAPI = (pageNum, pageSize, sortField, sortOrder, filter) => {
    return httpGet("/v1/soms/counterpartyPermission", {
        pageNum: pageNum,
        pageSize: pageSize,
        sortField: sortField,
        sortOrder: sortOrder,
        counterpartyId: filter.counterpartyId,
		counterpartyContactId: filter.counterpartyContactId,
		userId: filter.userId,
		username: filter.username,
		nickname: filter.nickname,
		permissionType: filter.permissionType,
		
    })
}

export const addCounterpartyPermissionAPI = (data) => {
    return httpPut("/v1/soms/counterpartyPermission", data)
}

export const getCounterpartyPermissionAPI = (data) => {
    return httpGet(`/v1/soms/counterpartyPermission/${data.id}`, {})
}

export const editCounterpartyPermissionAPI = (data) => {
    return httpPost(`/v1/soms/counterpartyPermission/${data.id}`, data)
}

export const deleteCounterpartyPermissionAPI = (ids) => {
    return httpPost(`/v1/soms/batchDeleteCounterpartyPermission`, {
        ids: ids,
    })
}

